const base= 'http://124.222.174.105:5930/';

function request (url, method, data, header = {}) {
  return new Promise((resolve, reject) => {
    mpvue.request({
      url: base+ url,
      method: method,
      data: data,
      success: function (res) {
        resolve(res.data)
      },
      fail: function (error) {
        reject(error)
      }
    })
  })
}

function get (url,data) {
  return request(url, 'GET', data)
}

function post (obj) {
  return request(url, 'POST', data)
}

export default {
  request,
  get,
  post
}
